# $Id: Makefile,v 2.1.0.9 1997/10/29 19:36:07 sauderd Exp $

# This code was developed with the support of the United States Government,
# and is not subject to copyright.

MAKE_RULES =  ../../make_rules
include $(MAKE_RULES)

PDES = ../../..

############################################################### 

#  This Makefile builds the SCL utils library.  All files below this
#  point are made using relative paths based on the PDES and LIBRARY
#  macro.  The make_rules file specifies which compiler and 
#  preprocessors will be used.

LIBRARY = ../../lib/libCutils.a

###############################################################


UTILS = $(PDES)/src/clutils

INCLUDES =	-I../.. $(MR_INCLUDES) \
		-I$(UTILS) 

METAFILES = \
	Str.o \
	dirobj.o \
	gennode.o \
	gennodelist.o \
	gennodearray.o \
	scl_hash.o \
	errordesc.o  \
	scl_string.o \
	scl_char_str_list.o 
 


# This makefile is architecture independent but it relies an a directory 
# named arch$(TARGET_ARCH) to put the object files in the right place

#
# Not needed now that scl_hash has been rewritten in C++
#
#%.o::  $(UTILS)/%.c
#	@echo " "
#	@echo "compiling $< - C source code";
#	$(cc) $(CDEBUGFLAGS) $(CFLAGS) $(INCLUDES) -c $<
#	@echo " "

%.o::  $(UTILS)/%.cc
	@echo " "
	@echo "compiling $<"; 
	$(CXX) $(CFLAGS)  $(INCLUDES)  -c $<; 

all: $(LIBRARY)

$(LIBRARY): $(METAFILES)
	@echo " "
	@echo "making $(LIBRARY)"
	echo "ar rc $(LIBRARY) $?"; \
	ar rc $(LIBRARY) $?; \
	echo "$(RANLIB) $(LIBRARY)"; \
	$(RANLIB) $(LIBRARY); \

clean:
	rm $(METAFILES) $(LIBRARY)

build:	checkout all

checkout:
	cd $(UTILS); co checkout; checkout;
 
depend:
	$(MAKE_DEPEND) $(MR_COND_DEFS) $(CPLUSINCLUDES) $(INCLUDES) $(UTILS)/*.cc
#	makedepend $(INCLUDES) $(COND_DEFS) $(UTILS)/*.cc $(UTILS)/*.c

#
# dependencies generated by makedepend
#

# DO NOT DELETE THIS LINE -- make depend depends on it.
